<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>键盘事件</title>
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>

    <body>
        <div id="root">
            <input type="text" placeholder="请输入信息" v-on:keyup.huiche = showInfo>
        </div>

        <script type="text/javascript">
            Vue.config.keyCodes = {
              "huiche": 13
            };
            const vm = new Vue({
                el:'#root',
                data:{

                },
                methods: {
                  showInfo(e) {
                    console.log(e.target.value)
                  }
                }
            })
        </script>
    </body>
</html>